//
//  ViewController.m
//  Button Fun
//
//  Created by dbseti on 16/12/4.
//  Copyright © 2016年 dbseti. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)buttonPressed:(UIButton *)sender {
    NSString *title=[sender titleForState:(UIControlStateNormal)];
    NSString *plainText=[NSString stringWithFormat:@"%@ button pressed.",title];
    //_statusLabel.text=plainText;
    NSMutableAttributedString *styledText = [[NSMutableAttributedString alloc]initWithString:plainText];
    NSDictionary *attributes = @{NSFontAttributeName : [UIFont boldSystemFontOfSize:_statusLabel.font.pointSize]}   ;
    NSRange nameRange = [plainText rangeOfString:title];
    [styledText setAttributes:attributes range:nameRange];
    _statusLabel.attributedText = styledText;
    //This code is modified in 2017.03.30

}
@end
